3.6.52 \(\int \frac {x^2 (A+B x)}{a^2+2 a b x+b^2 x^2} \, dx\)

Optimal. Leaf size=69 \[ -\frac {a^2 (A b-a B)}{b^4 (a+b x)}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}+\frac {x (A b-2 a B)}{b^3}+\frac {B x^2}{2 b^2} \]

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {27, 77} \begin {gather*} -\frac {a^2 (A b-a B)}{b^4 (a+b x)}+\frac {x (A b-2 a B)}{b^3}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}+\frac {B x^2}{2 b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x^2*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2),x]

[Out]

((A*b - 2*a*B)*x)/b^3 + (B*x^2)/(2*b^2) - (a^2*(A*b - a*B))/(b^4*(a + b*x)) - (a*(2*A*b - 3*a*B)*Log[a + b*x])
/b^4

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin {align*} \int \frac {x^2 (A+B x)}{a^2+2 a b x+b^2 x^2} \, dx &=\int \frac {x^2 (A+B x)}{(a+b x)^2} \, dx\\ &=\int \left (\frac {A b-2 a B}{b^3}+\frac {B x}{b^2}-\frac {a^2 (-A b+a B)}{b^3 (a+b x)^2}+\frac {a (-2 A b+3 a B)}{b^3 (a+b x)}\right ) \, dx\\ &=\frac {(A b-2 a B) x}{b^3}+\frac {B x^2}{2 b^2}-\frac {a^2 (A b-a B)}{b^4 (a+b x)}-\frac {a (2 A b-3 a B) \log (a+b x)}{b^4}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 66, normalized size = 0.96 \begin {gather*} \frac {\frac {2 a^2 (a B-A b)}{a+b x}+2 b x (A b-2 a B)+2 a (3 a B-2 A b) \log (a+b x)+b^2 B x^2}{2 b^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2),x]

[Out]

(2*b*(A*b - 2*a*B)*x + b^2*B*x^2 + (2*a^2*(-(A*b) + a*B))/(a + b*x) + 2*a*(-2*A*b + 3*a*B)*Log[a + b*x])/(2*b^
4)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^2 (A+B x)}{a^2+2 a b x+b^2 x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(x^2*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2),x]

[Out]

IntegrateAlgebraic[(x^2*(A + B*x))/(a^2 + 2*a*b*x + b^2*x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 113, normalized size = 1.64 \begin {gather*} \frac {B b^{3} x^{3} + 2 \, B a^{3} - 2 \, A a^{2} b - {\left (3 \, B a b^{2} - 2 \, A b^{3}\right )} x^{2} - 2 \, {\left (2 \, B a^{2} b - A a b^{2}\right )} x + 2 \, {\left (3 \, B a^{3} - 2 \, A a^{2} b + {\left (3 \, B a^{2} b - 2 \, A a b^{2}\right )} x\right )} \log \left (b x + a\right )}{2 \, {\left (b^{5} x + a b^{4}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="fricas")

[Out]

1/2*(B*b^3*x^3 + 2*B*a^3 - 2*A*a^2*b - (3*B*a*b^2 - 2*A*b^3)*x^2 - 2*(2*B*a^2*b - A*a*b^2)*x + 2*(3*B*a^3 - 2*
A*a^2*b + (3*B*a^2*b - 2*A*a*b^2)*x)*log(b*x + a))/(b^5*x + a*b^4)

________________________________________________________________________________________

giac [A]  time = 0.16, size = 75, normalized size = 1.09 \begin {gather*} \frac {{\left (3 \, B a^{2} - 2 \, A a b\right )} \log \left ({\left | b x + a \right |}\right )}{b^{4}} + \frac {B b^{2} x^{2} - 4 \, B a b x + 2 \, A b^{2} x}{2 \, b^{4}} + \frac {B a^{3} - A a^{2} b}{{\left (b x + a\right )} b^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="giac")

[Out]

(3*B*a^2 - 2*A*a*b)*log(abs(b*x + a))/b^4 + 1/2*(B*b^2*x^2 - 4*B*a*b*x + 2*A*b^2*x)/b^4 + (B*a^3 - A*a^2*b)/((
b*x + a)*b^4)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 84, normalized size = 1.22 \begin {gather*} \frac {B \,x^{2}}{2 b^{2}}-\frac {A \,a^{2}}{\left (b x +a \right ) b^{3}}-\frac {2 A a \ln \left (b x +a \right )}{b^{3}}+\frac {A x}{b^{2}}+\frac {B \,a^{3}}{\left (b x +a \right ) b^{4}}+\frac {3 B \,a^{2} \ln \left (b x +a \right )}{b^{4}}-\frac {2 B a x}{b^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(B*x+A)/(b^2*x^2+2*a*b*x+a^2),x)

[Out]

1/2*B*x^2/b^2+1/b^2*A*x-2/b^3*B*a*x-2*a/b^3*ln(b*x+a)*A+3*a^2/b^4*ln(b*x+a)*B-a^2/b^3/(b*x+a)*A+a^3/b^4/(b*x+a
)*B

________________________________________________________________________________________

maxima [A]  time = 0.47, size = 74, normalized size = 1.07 \begin {gather*} \frac {B a^{3} - A a^{2} b}{b^{5} x + a b^{4}} + \frac {B b x^{2} - 2 \, {\left (2 \, B a - A b\right )} x}{2 \, b^{3}} + \frac {{\left (3 \, B a^{2} - 2 \, A a b\right )} \log \left (b x + a\right )}{b^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)/(b^2*x^2+2*a*b*x+a^2),x, algorithm="maxima")

[Out]

(B*a^3 - A*a^2*b)/(b^5*x + a*b^4) + 1/2*(B*b*x^2 - 2*(2*B*a - A*b)*x)/b^3 + (3*B*a^2 - 2*A*a*b)*log(b*x + a)/b
^4

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 77, normalized size = 1.12 \begin {gather*} x\,\left (\frac {A}{b^2}-\frac {2\,B\,a}{b^3}\right )+\frac {B\,x^2}{2\,b^2}+\frac {B\,a^3-A\,a^2\,b}{b\,\left (x\,b^4+a\,b^3\right )}+\frac {\ln \left (a+b\,x\right )\,\left (3\,B\,a^2-2\,A\,a\,b\right )}{b^4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2*(A + B*x))/(a^2 + b^2*x^2 + 2*a*b*x),x)

[Out]

x*(A/b^2 - (2*B*a)/b^3) + (B*x^2)/(2*b^2) + (B*a^3 - A*a^2*b)/(b*(a*b^3 + b^4*x)) + (log(a + b*x)*(3*B*a^2 - 2
*A*a*b))/b^4

________________________________________________________________________________________

sympy [A]  time = 0.36, size = 68, normalized size = 0.99 \begin {gather*} \frac {B x^{2}}{2 b^{2}} + \frac {a \left (- 2 A b + 3 B a\right ) \log {\left (a + b x \right )}}{b^{4}} + x \left (\frac {A}{b^{2}} - \frac {2 B a}{b^{3}}\right ) + \frac {- A a^{2} b + B a^{3}}{a b^{4} + b^{5} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(B*x+A)/(b**2*x**2+2*a*b*x+a**2),x)

[Out]

B*x**2/(2*b**2) + a*(-2*A*b + 3*B*a)*log(a + b*x)/b**4 + x*(A/b**2 - 2*B*a/b**3) + (-A*a**2*b + B*a**3)/(a*b**
4 + b**5*x)

________________________________________________________________________________________